//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
// 
// You should have received a copy of the GNU Lesser General Public License
// along with this program.  If not, see http://www.gnu.org/licenses/.
// 

import inet.nodes.inet.StandardHost;
import inet.applications.udpapp.UDPBasicApp;
//import inet.applications.pingapp.PingApp;

//simple PingTest extends PingApp {
//	parameters:
//		count = 1;
//		printPing = false;
//		destAddr = "tracker";
//		startTime = 2;
//		stopTime = 1;
//}

simple PeerApp extends UDPBasicApp
{
    parameters:
        @display("i=block/app");
        @class(PeerApp);
        string trackerAddr;
        
        int id;
	int streamID;
	int startedAt;
        
        int peerListRetries;
        int maxUploads;
	double sendDataTime;
	double trackCheckTime;
	int chunksToAdv;
	int minChunks;
	int maxChunks;
	int rank;
	bool geoAware;
        
}

module Peer extends StandardHost
{
	parameters:
		@display("i=device/pc_vs");

	submodules:
		app: PeerApp {};
	
	connections:
    
	        app.udpOut --> udp.appIn++;
	        app.udpIn <-- udp.appOut++;
}
